package com.library.dao;

import com.library.domain.BookInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
@Mapper
public interface BookInfoDao {
    @Select("select * from book_info;")
    List<BookInfo> selectBookInfo();
/*
* 加一层防护status=0,但是经过测试，先去掉，因为刷新
*
* */
    @Update("update book_info set status=1 where id=#{id} ")
    int updateBookLendStatus(Integer id);

    /*
    * */
    @Select("select * from book_info where id=#{id} ")
    BookInfo selectBookById(Integer id);
}
